package com.zhuoan.im.webapp.biz.impl;

import com.zhuoan.im.webapp.biz.GroupMemberBiz;
import com.zhuoan.im.webapp.dao.mapper.GroupMemberMapper;
import com.zhuoan.im.webapp.dao.model.GroupMember;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * GroupMemberBizImpl
 *
 * @author weixiang.wu
 * @date 2018-10-17 19:08
 **/
@Service
public class GroupMemberBizImpl implements GroupMemberBiz {
    private final static Logger logger = LoggerFactory.getLogger(GroupMemberBizImpl.class);

    @Resource
    private GroupMemberMapper groupMemberMapper;


    @Override
    public List<Long> queryInCurrentGroupUserIds(Long userGroupsId) {
        return groupMemberMapper.queryInCurrentGroupUserIds(userGroupsId);
    }

    @Override
    public int addGroupMember(GroupMember groupMember) {
        return groupMemberMapper.insertSelective(groupMember);
    }

    @Override
    public int removeMember(String groupId, String targetId) {
        return groupMemberMapper.removeMember(groupId,targetId);
    }
}
